package com.android.tea.widght;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;

import com.android.tea.R;

public class SettingItemPanel extends LinearLayout {

	public SettingItemPanel(Context context) {
		super(context);
		init();
	}

	public SettingItemPanel(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();

	}

	private void init() {
		setOrientation(LinearLayout.VERTICAL);
		setBackgroundResource(R.drawable.backgroundbind);
	}

	public void addItem(View view) {
		int count = this.getChildCount();
		if (count > 0) {
			LinearLayout layout = new LinearLayout(getContext());
			LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, 1);
//			layout.setPadding(-5, 0, -5, 0);
			layout.setLayoutParams(params);
			layout.setBackgroundColor(Color.parseColor("#cbcbcb"));
			addView(layout);
		}
		addView(view);
	}
}
